To create a single tween container, do the following:
Listing 6 shows how to create a single kTweenTypeLong tween container that a component could use to interpolate two long integers.
Listing 6 Creating a single kTweenTypeLong tween container
QTAtomContainer container = nil;
long tweenDataLong[2];
QTAtomType tweenType;
QTAtom tweenAtom;
tweenDataLong[0] = EndianU32_NtoB(512);
tweenDataLong[1] = EndianU32_NtoB(0);
// create a new atom container
QTNewAtomContainer (&container);
// create the parent tween entry atom
tweenType = kTweenTypeLong;
QTInsertChild (container, kParentAtomIsContainer, kTweenEntry, 1, 0, 0,
nil, &tweenAtom);
// add two child atoms to the tween entry atom --
// * the type atom, kTweenType
QTInsertChild (container, tweenAtom, kTweenType, 1, 0,
sizeof(tweenType), &tweenType, nil);
// * the data atom, kTweenData
QTInsertChild (container, tweenAtom, kTweenData, 1, 0,
sizeof(long) * 2, tweenDataLong, nil);
| Previous | Chapter Contents | Chapter Top | Next |